-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(trie): Fix trie_reverts not returning sorted nodes #19280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As a more future-proof fix, I've also made the fields of the TrieNodesSorted struct private, and introduced a constructor which will do a debug_assert that the input is already sorted.
| } | ||
|
|
||
| Ok(trie_updates) | ||
| Ok(TrieUpdatesSorted::new(account_nodes, storage_tries)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case does not require explicit sorting, as the vecs are constructed in sorted order inherently thanks to the DB
Rjected
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me, just have a doc nit
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense
As a more future-proof fix, I've also made the fields of the TrieNodesSorted struct private, and introduced a constructor which will do a debug_assert that the input is already sorted.